<style>
	ul{
		list-style: none;
	}
	ul li {
		display:inline;
	}
	.action{
		color:blue;
		font-weight: bold;
	}
</style>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:10px;">
	<tbody>
		<tr>
			<td class="bgtitle">
				<table width="100%" border="0" cellspacing="0" cellpadding="0" id="abc">
					<tbody>
						<tr>
							<td>
								<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
									<tbody>
										<tr>
											<td width="20">
												<img src="/templates/images/mui_ten.gif"></td>
											<td valign="bottom" class="title">
												<div id="danhmucsanpham">
													<!-- Sửa -->
													<h1 class="addtitle">Kết quả tìm kiếm</h1>
												</div>    
											</td>
											<td width="10" valign="bottom">&nbsp;</td>
										</tr>
									</tbody>
								</table>
							</td>
							<td width="220" valign="bottom" bgcolor="#FFFFFF">
								<table border="0" align="right" cellpadding="0" cellspacing="0">
									<tbody>
										<tr>
											<td>
												<div align="right">Sắp xếp theo:</div>
											</td>   
											<td width="5" valign="bottom" class="title">
												<img src="/templates/images/space.gif" width="5" height="1">
											</td>
											<td valign="bottom" class="title">
												<script language="javascript">
													function getproduct(theprokind)
													{	
														document.location = 'productpage-3-36-0-'+theprokind.value+'-index.tpl'
													}
												</script>

												<select name="order" id="order" class="box_input" onchange="getproduct(this)">
													<option value="1" selected="">Giá thấp đến cao </option>
													<option value="2">Giá cao đến thấp</option>
													<option value="3">Xem nhiều</option>
													<option value="0">Mới cập nhật</option>
												</select>
											</td>
										</tr>
									</tbody>
								</table>
							</td>    
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top">
				<img src="/templates/images/space.gif" width="1" height="10">
			</td>
		</tr>
	</tbody>
</table>
{if $product==null}
	ko có đúa nào cả
	{else}
<table width="98%" border="0" align="center" height="25" cellpadding="0" cellspacing="0">
	<tbody>
		<tr> 
			<td>Sản phẩm: <strong><!--1 trang thì bắt đầu từ 1-->
					{if $record==0}
						0
					{else}
						{$display+$prev+1}<!--số hiện thị pre()-->
					{/if}
				</strong> - <strong>
					{if $page==1}
						{$record}
					{else}
						{if $next<$record}
							{$next}
						{else}
							{$record}
						{/if}
					{/if}
				</strong> trong tổng số: <strong>{$record}</strong> sản phẩm</td>
			<td width="280px" style="text-align:right">
				<ul>
					<!--nhìu hơn 1 trang mới có cái này-->
					{if $page!=1}
						{if $current!=1}<!--nếu trang hiện tai ko phải là trang 1 thì mới có-->
							<li>
								<a href="/search/start/{$prev}">Trang trước</a>
							</li>
						{/if}
						<!--hien thi trang next-->
						{for $item=1;$item<$page+1;$item++}
						{if $current!=$item}

							<li>
								<a href='/search/start/{$display*($item-1)}'>{$item}</a>
							</li>
						{else}
							<li>
								<a class="action">{$item}</a>
							</li>
						{/if}
						{/for}
						{if $current!=$page}
							<!--nếu trang hiện tai ko phải là trang cuối thì mới có-->
							<li>
								<a href="/search/start/{$next}">Trang sau</a>
							</li>
						{/if}
					{/if}
				</ul>
			</td>
		</tr>
	</tbody>
</table>

<table align="center" border="0" cellpadding="0" cellspacing="0">
	<tbody>
		{foreach from=$product item=product_item}
			{if $product_item@index % 3== 0}
				<tr>
				{/if}
				<td valign="top">
					<input name="idprocheck[]" type="hidden" value="259">
					<table width="260" border="0" align="center" cellpadding="0" cellspacing="0">
						<tbody>
							<tr>
								<td> 
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td width="11">
													<img src="/templates/images/tbl_pro1.jpg" width="11" height="11">
												</td>
												<td background="/templates/images/tbl_pro2.jpg">
													<img src="/templates/images/tbl_pro2.jpg" width="1" height="11">
												</td>
												<td width="11">
													<img src="/templates/images/tbl_pro3.jpg" width="11" height="11">
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
												<td>
													<img src="/templates/images/posts.gif">&nbsp;
													<!-- Sửa -->
													<a href="/product/camera" class="linktitlebox">Máy ảnh</a> | 
													<a href="/{$product_item.link}" class="linktitlebox">{$product_item.categoryname}</a>
													{if $promotion_start == 1}
														<span style="float: right; font-weight: bold; margin-top: 2px; color:red">{$promotionbytime.percentdiscount}%</span>
														<img src="/templates/images/sale.png" style="float: right;">
													{/if}
												</td>
												<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
											</tr>
											<tr>
												<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
												<td height="270">
													<div align="center">
														<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
															<tbody>
																<tr>
																	<td align="left">
																		<!-- Sửa --> 
																		<a style="cursor:hand" href="/productdetail/{$product_item.idproduct}"> 
																			<img src="/templates/images/product/{$product_item.image}" alt="{$product_item.productname}" width="180" height="260" border="0"> 
																		</a>
																	</td>
																</tr>
															</tbody>
														</table>
													</div>
												</td>
												<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
											</tr>
											<tr>
												<td width="11" style="background-image:url('/templates/images/tbl_pro4.jpg'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
												<td height="50" valign="top">
													<div align="center">
														<h3 style="margin:0px;">
															<!-- Sửa -->
															<a style="cursor:hand" href="/productdetail/{$product_item.idproduct}" class="linkblack">{$product_item.productname}</a>
														</h3>
														<span class="{if $promotion_start == 1}fontgrayprice{else}fontred{/if}">{$product_item.price|number_format} VNĐ</span>
														<br>
														{if $promotion_start == 1}
															<img src="/templates/images/sale_arrow.png" style="position: absolute; margin-top: -11px; margin-left: -60px;">
															<span class="fontred">{($product_item.price*(100-$promotionbytime.percentdiscount)/100)|number_format} VNĐ</span>
															<br>
														{/if}
														<span class="fontgreen">{$product_item.promotion}</span>
													</div>
												</td>
												<td width="11" style="background-image:url('/templates/images/tbl_pro5.jpg'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table width="100%" border="0" cellspacing="0" cellpadding="0">
										<tbody>
											<tr>
												<td width="11">
													<img src="/templates/images/tbl_pro6.jpg" width="11" height="44"></td>
												<td background="/templates/images/tbl_pro7.jpg" style="padding-bottom:3px">
													<form action="/cart/add/{$product_item.idproduct}" method="post" style="margin:0">
														<table border="0" align="center" cellpadding="2" cellspacing="0">
															<!-- Sửa -->
															<input type="hidden" name="idcth" value="{$product_item.productid}">
															<input type="hidden" name="proname" value="{$product_item.productname}">
															<input type="hidden" name="price" value="{$product_item.price}">
															<input type="hidden" name="poids" value="">
															<input type="hidden" name="img" value="{$product_item.image}">
															<tbody>
																<tr>
																	<!-- Nút chi tiết  -->
																	<td>
																		<a style="cursor:hand" href="/productdetail/{$product_item.idproduct}">
																			<img src="/templates/images/but-detail.jpg" border="0"></a>
																	</td>
																	<td width="2">
																		<img src="/templates/images/space.gif" width="2">
																	</td>
																	<!--nut mua-->
																	<td>
																		{if ($product_item.inventory - $product_item.quantity_buying) > 0}
																			<input type="image" src="/templates/images/but-book.jpg"></a>
																		{else}
																			<span class="fontred">Hết hàng</span>
																		{/if}
																	</td>
																</tr>
															</tbody>
														</table>
													</form>
												</td>
												<td width="11">
													<img src="/templates/images/tbl_pro8.jpg" width="11" height="44">
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</tbody>
					</table>
				</td>
				{if $product_item@index %3 == 2}
				</tr>
			{/if}
		{/foreach}

		<tr>
		</tr>
	</tbody>
</table>

<table width="98%" border="0" align="center" height="25" cellpadding="0" cellspacing="0">
	<tbody>
		<tr> 
			<td>Sản phẩm: <strong><!--1 trang thì bắt đầu từ 1-->
					{if $record==0}
						0
					{else}
						{$display+$prev+1}<!--số hiện thị pre()-->
					{/if}
				</strong> - <strong>
					{if $page==1}
						{$record}
					{else}
						{if $next<$record}
							{$next}
						{else}
							{$record}
						{/if}
					{/if}
				</strong> trong tổng số: <strong>{$record}</strong> sản phẩm</td>
		</tr>
	</tbody>
</table>
		{/if}
<style>
	#danhmucsanpham{
		position: relative;
	}
	h1.addtitle{
		font-size:18px;
		margin:0px;
		display:inline;
	}
	span#titlecategory {
		position: absolute;
		top:-21px;
	}
	#titlecategory a{
		font-size:11px;
	}
</style>
